﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Text.RegularExpressions;

namespace ShoppingList.Helpers
{
    public static class StringHelpers
    {
        public static bool NoNumberString(string value)
        {
            string pattern=@"^[a-zA-Z]+(([\'\,\.\- ][a-zA-Z ])?[a-zA-Z]*)*$";
            Regex condition = new Regex(pattern);
            return condition.IsMatch(value);
        }

        public static bool OnlyNumbersWithOneDecimal(double value)
        {
            string pattern = @"^([0-9]*|\d*\.\d{1}?\d*)$";
            Regex condition = new Regex(pattern);
            return condition.IsMatch(value.ToString());
        }
        public static bool OnlyNumbersWithOutDecimals(double value)
        {


            string pattern = @"^\d+$";
            Regex condition = new Regex(pattern);
            return condition.IsMatch(value.ToString());
        }
    }
}
